home *** CD-ROM | disk | FTP | other *** search
/ PC Users 1999 April / Cd Pc Users extra 19 abril 1999.iso / Prog / Inst / Js02 / js02.exe / jscripts / mvdwv01.js < prev    next >
Encoding:
JavaScript  |  1998-11-12  |  1.5 KB  |  39 lines

  1. //----------------------------------------------------------------------
  2. // JavaScript Code for Navigator 4+ and Internet Explorer 4+
  3. //-------------------------------------------------------------------
  4. // Moving Object Down
  5. // signe_browser=0: Netscape Navigator 4 & signe_browser=1: Internet Explorer 4
  6. // ly:         object which is moving
  7. // signe_up=0     Initialization
  8. // newposDown:     New Position of Object ; newposDown=0 (initial value for Navigator)
  9. // limitStep:     pixel size for step  
  10. // stepDown:      pixel size initial for step
  11. // limitDown:     limit distance for moving 
  12. // dtime:         timeout for moving object in ms
  13. //---------------------------------------------------------------------
  14.  
  15. function movingDown(signe_browser,ly,signe_up,newposDown,stepDown,limitStep,limitDown,dtime){
  16.     if (signe_up==0) {
  17.         if (signe_browser==0) newposDown=document[ly].top;
  18.         signe_up=1;
  19.             stepDown=newposDown/2;
  20.     }
  21.       if (newposDown < limitDown ) {
  22.           newposDown=newposDown+stepDown;
  23.         if (stepDown > limitStep) stepDown=stepDown/2;
  24.         if (signe_browser==0) document[ly].top=newposDown;
  25.         if (signe_browser==1) document.all[ly].style.top=newposDown;
  26.           var timeout_id_movingDown=setTimeout("movingDown("+signe_browser+",'"+ly+"',"+signe_up+","+newposDown+","+stepDown+","+limitStep+","+limitDown+","+dtime+")", dtime);
  27.           return;
  28.     }
  29.       if (newposDown >= limitDown ) {
  30.         clearTimeout(timeout_id_movingDown);
  31.         timeout_id_movingDown=null;
  32.         end_movingDown();
  33.     }
  34. }
  35.  
  36.  
  37.  
  38.  
  39.